{# Copyright 2014-2015 Siemens AG

   Copying and distribution of this file, with or without modification,
   are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
   This file is offered as-is, without any warranty.
#}
{% import "include/macros.html.twig" as macro %}
<h3>{{ "Scanner details"|trans }}</h3>
{% if agentMap|length==0 %}
  {{ 'There is no successful scan for this upload, please schedule one license scanner on this upload.'|trans }}
{% elseif agentMap|length==1 %}
  {{ 'Only one revision of'|trans }} <b>{{ agentMap|first }}</b> {{ 'ran for this upload'|trans }}. <br/>
{% else %}
  <form action="{{ agentShowURI }}" method="post">
    <select class="form-control-sm" name="agentId" id="agentId">
      <option value="0">{{ 'Latest run of all available agents'|trans }}</option>
    {% for key, value in agentMap %}
      <option value="{{ key }}"{% if agentId == key %} selected="selected"{% endif %}>
        {{ value }}
      </option>
    {% endfor %}
    </select>
    <input type="submit" class="btn btn-default btn-sm" name="s" value="{{'Show'|trans}}"/>
  </form>
{% endif %}

{% for s in scanners %}
  <div style="border: 1px dashed gray;">
  {% include 'browse_license-agent.html.twig' with {
     'agentName':s.agentName,
     'successfulAgents':s.successfulAgents,
     'uploadId':s.uploadId,
     'agentName':s.agentName,
     'isAgentRunning':s.isAgentRunning,
     'currentAgentId':s.currentAgentId,
     'currentAgentRev':s.currentAgentRev}
  %}
  </div>
{% endfor %}
